﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:extented="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:renderer="clr-namespace:AzukiMap.Renderer;assembly=AzukiMap"
	x:Class="AzukiMapUI.Page"
	Width="640" Height="480" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" 
    xmlns:AzukiMapUI="clr-namespace:AzukiMapUI"
    >

    <Grid x:Name="LayoutRoot" Background="White">
        <!-- grid definitions -->
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="1*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="24"/>
            <RowDefinition Height="1*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="100"/>
            <RowDefinition Height="24"/>
        </Grid.RowDefinitions>

        <extented:GridSplitter ShowsPreview="True" Grid.Row="2" Grid.Column="0" Height="4" Grid.RowSpan="1" Background="#FFECECEC" HorizontalAlignment="Stretch" Cursor="SizeNS"/>
        <extented:GridSplitter ShowsPreview="True" Grid.Row="1" Grid.Column="1" Width="4" Grid.RowSpan="3" Background="#FFECECEC" HorizontalAlignment="Stretch" Cursor="SizeWE"/>

        <!-- header -->
        <Rectangle HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Grid.ColumnSpan="3" Grid.Row="0" Fill="#FFFFFFFF"/>
        <AzukiMapUI:AzukiMapLogo HorizontalAlignment="Right" Grid.Column="2" d:LayoutOverrides="Width, Height" Margin="0,-2,2,0" VerticalAlignment="Top" Cursor="Stylus" />

        <!-- icon stack -->
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Background="#FFF0F0F0" d:LayoutOverrides="GridBox" OpacityMask="#FF000000">
            <Button x:Name="BtnSave" Click="BtnSave_Click" BorderBrush="{x:Null}" BorderThickness="0.5,0.5,0.5,0.5" Margin="1,1,1,1" Background="{x:Null}" Foreground="{x:Null}">
                <Button.Content>
                    <Image HorizontalAlignment="Left" Width="16" Source="icons/disk.png" Stretch="Fill"/>
                </Button.Content>
            </Button>

        </StackPanel>

        <!-- map canvas -->
        <Border HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Grid.Column="2" Grid.Row="1" Grid.RowSpan="3" BorderBrush="#FF000000" BorderThickness="0.5,0.5,0.5,0.5" CornerRadius="5,5,5,5">
            <Canvas x:Name="MapCanvas" HorizontalAlignment="Stretch" Margin="1,1,1,1" VerticalAlignment="Stretch">
            </Canvas>
        </Border>

        <!-- layer control -->
        <AzukiMapUI:LayerControl x:Name="WndLayerControl" AddLayerPressed="WndLayerControl_AddLayerPressed" LayerSettingPressed="WndLayerExpression_LayerSettingPressed" Grid.Row="1"></AzukiMapUI:LayerControl>

        <!-- logger -->
        <AzukiMapUI:LogDisplay x:Name="WndLogDisplay" Grid.Row="3"/>

        <!-- footer -->
        <Rectangle HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Grid.ColumnSpan="3" Grid.Row="4" Fill="#FFEEEEEE"/>

        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,0,0" VerticalAlignment="Center" Grid.Row="4" Background="#FFF0F0F0" d:LayoutOverrides="GridBox" Grid.Column="2">
            <!-- memory usage -->
            <Button x:Name="BtnSweep" Click="BtnSweep_Click" BorderBrush="{x:Null}" BorderThickness="0.5,0.5,0.5,0.5" Margin="1,1,1,1" Background="{x:Null}" Foreground="{x:Null}">
                <Button.Content>
                    <Image Source="icons/sweep.png" Stretch="Fill" VerticalAlignment="Center" Height="16" Width="16"/>
                </Button.Content>
            </Button>
            <TextBlock Margin="4,0,4,0" Width="Auto" Text="0.0" TextWrapping="NoWrap" FontFamily="Verdana" FontSize="12" x:Name="memoryUsage"/>
            <TextBlock Margin="0,0,4,0" Width="Auto" Text="MB" TextWrapping="NoWrap" FontFamily="Verdana" FontSize="12"/>
            <TextBlock Margin="0,0,4,0" Width="Auto" Text="|" TextWrapping="NoWrap" FontFamily="Verdana" FontSize="12"/>
            <!-- map scale -->
            <TextBlock Margin="0,0,4,0" Width="85" Text="1:1" TextWrapping="NoWrap" FontFamily="Verdana" FontSize="12" x:Name="mapScale" HorizontalAlignment="Stretch"/>
            <TextBlock Margin="0,0,4,0" Width="Auto" Text="|" TextWrapping="NoWrap" FontFamily="Verdana" FontSize="12"/>
            <!-- map extents -->
            <TextBlock Margin="0,0,0,0" Width="Auto" Text="(" TextWrapping="NoWrap" FontFamily="Verdana" FontSize="12"/>
            <TextBlock Margin="0,0,0,0" Width="50" Text="x1" TextWrapping="NoWrap" FontFamily="Verdana" FontSize="12" x:Name="mapRectX1"/>
            <TextBlock Margin="0,0,0,0" Width="Auto" Text="," TextWrapping="NoWrap" FontFamily="Verdana" FontSize="12"/>
            <TextBlock Margin="0,0,0,0" Width="50" Text="y1" TextWrapping="NoWrap" FontFamily="Verdana" FontSize="12" x:Name="mapRectY1"/>
            <TextBlock Margin="0,0,0,0" Width="Auto" Text=") - (" TextWrapping="NoWrap" FontFamily="Verdana" FontSize="12"/>
            <TextBlock Margin="0,0,0,0" Width="50" Text="x2" TextWrapping="NoWrap" FontFamily="Verdana" FontSize="12" x:Name="mapRectX2"/>
            <TextBlock Margin="0,0,0,0" Width="Auto" Text="," TextWrapping="NoWrap" FontFamily="Verdana" FontSize="12"/>
            <TextBlock Margin="0,0,0,0" Width="50" Text="y2" TextWrapping="NoWrap" FontFamily="Verdana" FontSize="12" x:Name="mapRectY2"/>
            <TextBlock Margin="0,0,0,0" Width="Auto" Text=") " TextWrapping="NoWrap" FontFamily="Verdana" FontSize="12"/>
        </StackPanel>
        <AzukiMapUI:LayerSelectDialog x:Name="WndLayerSelecter" Grid.RowSpan="5" Grid.ColumnSpan="3" Visibility="Collapsed" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Top" Canvas.ZIndex="100" Margin="0,0,0,0" />
    </Grid>
</UserControl>